<?php

/**
 * Application Models
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 * @copyright ZF model generator
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * Abstract class for models
 */
require_once 'ModelAbstract.php';

/**
 * 
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 */
class Application_Model_Sondagepersonne extends Application_Model_ModelAbstract
{

    /**
     * Database var type int(11)
     *
     * @var int
     */
    protected $_Idsondagepersonne;

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_Nom;

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_Prenom;

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_Login;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_Password;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_Passwordclaire;

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_Email;

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_Telephone;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_Adresse;

    /**
     * Database var type varchar(45)
     *
     * @var string
     */
    protected $_Role;

    /**
     * Database var type varchar(8)
     *
     * @var string
     */
    protected $_CIN;

    /**
     * Database var type varchar(15)
     *
     * @var string
     */
    protected $_ETATB;



    /**
     * Dependent relation fk_participation_sondagepersonne1
     * Type: One-to-Many relationship
     *
     * @var Application_Model_Participation
     */
    protected $_Participation;

    /**
     * Dependent relation fk_sondage_sondagepersonne1
     * Type: One-to-Many relationship
     *
     * @var Application_Model_Sondage
     */
    protected $_Sondage;

    /**
     * Sets up column and relationship lists
     */
    public function __construct()
    {
        parent::init();
        $this->setColumnsList(array(
            'idsondagepersonne'=>'Idsondagepersonne',
            'nom'=>'Nom',
            'prenom'=>'Prenom',
            'login'=>'Login',
            'password'=>'Password',
            'passwordclaire'=>'Passwordclaire',
            'email'=>'Email',
            'telephone'=>'Telephone',
            'adresse'=>'Adresse',
            'role'=>'Role',
            'CIN'=>'CIN',
            'ETATB'=>'ETATB',
        ));

        $this->setParentList(array(
        ));

        $this->setDependentList(array(
            'FkParticipationSondagepersonne1' => array(
                    'property' => 'Participation',
                    'table_name' => 'Participation',
                ),
            'FkSondageSondagepersonne1' => array(
                    'property' => 'Sondage',
                    'table_name' => 'Sondage',
                ),
        ));
    }

    /**
     * Sets column idsondagepersonne
     *
     * @param int $data
     * @return Application_Model_Sondagepersonne
     */
    public function setIdsondagepersonne($data)
    {
        $this->_Idsondagepersonne = $data;
        return $this;
    }

    /**
     * Gets column idsondagepersonne
     *
     * @return int
     */
    public function getIdsondagepersonne()
    {
        return $this->_Idsondagepersonne;
    }

    /**
     * Sets column nom
     *
     * @param string $data
     * @return Application_Model_Sondagepersonne
     */
    public function setNom($data)
    {
        $this->_Nom = $data;
        return $this;
    }

    /**
     * Gets column nom
     *
     * @return string
     */
    public function getNom()
    {
        return $this->_Nom;
    }

    /**
     * Sets column prenom
     *
     * @param string $data
     * @return Application_Model_Sondagepersonne
     */
    public function setPrenom($data)
    {
        $this->_Prenom = $data;
        return $this;
    }

    /**
     * Gets column prenom
     *
     * @return string
     */
    public function getPrenom()
    {
        return $this->_Prenom;
    }

    /**
     * Sets column login
     *
     * @param string $data
     * @return Application_Model_Sondagepersonne
     */
    public function setLogin($data)
    {
        $this->_Login = $data;
        return $this;
    }

    /**
     * Gets column login
     *
     * @return string
     */
    public function getLogin()
    {
        return $this->_Login;
    }

    /**
     * Sets column password
     *
     * @param text $data
     * @return Application_Model_Sondagepersonne
     */
    public function setPassword($data)
    {
        $this->_Password = $data;
        return $this;
    }

    /**
     * Gets column password
     *
     * @return text
     */
    public function getPassword()
    {
        return $this->_Password;
    }

    /**
     * Sets column passwordclaire
     *
     * @param text $data
     * @return Application_Model_Sondagepersonne
     */
    public function setPasswordclaire($data)
    {
        $this->_Passwordclaire = $data;
        return $this;
    }

    /**
     * Gets column passwordclaire
     *
     * @return text
     */
    public function getPasswordclaire()
    {
        return $this->_Passwordclaire;
    }

    /**
     * Sets column email
     *
     * @param string $data
     * @return Application_Model_Sondagepersonne
     */
    public function setEmail($data)
    {
        $this->_Email = $data;
        return $this;
    }

    /**
     * Gets column email
     *
     * @return string
     */
    public function getEmail()
    {
        return $this->_Email;
    }

    /**
     * Sets column telephone
     *
     * @param string $data
     * @return Application_Model_Sondagepersonne
     */
    public function setTelephone($data)
    {
        $this->_Telephone = $data;
        return $this;
    }

    /**
     * Gets column telephone
     *
     * @return string
     */
    public function getTelephone()
    {
        return $this->_Telephone;
    }

    /**
     * Sets column adresse
     *
     * @param text $data
     * @return Application_Model_Sondagepersonne
     */
    public function setAdresse($data)
    {
        $this->_Adresse = $data;
        return $this;
    }

    /**
     * Gets column adresse
     *
     * @return text
     */
    public function getAdresse()
    {
        return $this->_Adresse;
    }

    /**
     * Sets column role
     *
     * @param string $data
     * @return Application_Model_Sondagepersonne
     */
    public function setRole($data)
    {
        $this->_Role = $data;
        return $this;
    }

    /**
     * Gets column role
     *
     * @return string
     */
    public function getRole()
    {
        return $this->_Role;
    }

    /**
     * Sets column CIN
     *
     * @param string $data
     * @return Application_Model_Sondagepersonne
     */
    public function setCIN($data)
    {
        $this->_CIN = $data;
        return $this;
    }

    /**
     * Gets column CIN
     *
     * @return string
     */
    public function getCIN()
    {
        return $this->_CIN;
    }

    /**
     * Sets column ETATB
     *
     * @param string $data
     * @return Application_Model_Sondagepersonne
     */
    public function setETATB($data)
    {
        $this->_ETATB = $data;
        return $this;
    }

    /**
     * Gets column ETATB
     *
     * @return string
     */
    public function getETATB()
    {
        return $this->_ETATB;
    }

    /**
     * Sets dependent relations fk_participation_sondagepersonne1
     *
     * @param array $data An array of Application_Model_Participation
     * @return Application_Model_Sondagepersonne
     */
    public function setParticipation(array $data)
    {
        $this->_Participation = array();

        foreach ($data as $object) {
            $this->addParticipation($object);
        }

        return $this;
    }

    /**
     * Sets dependent relations fk_participation_sondagepersonne1
     *
     * @param Application_Model_Participation $data
     * @return Application_Model_Sondagepersonne
     */
    public function addParticipation(Application_Model_Participation $data)
    {
        $this->_Participation[] = $data;
        return $this;
    }

    /**
     * Gets dependent fk_participation_sondagepersonne1
     *
     * @param boolean $load Load the object if it is not already
     * @return array The array of Application_Model_Participation
     */
    public function getParticipation($load = true)
    {
        if ($this->_Participation === null && $load) {
            $this->getMapper()->loadRelated('FkParticipationSondagepersonne1', $this);
        }

        return $this->_Participation;
    }

    /**
     * Sets dependent relations fk_sondage_sondagepersonne1
     *
     * @param array $data An array of Application_Model_Sondage
     * @return Application_Model_Sondagepersonne
     */
    public function setSondage(array $data)
    {
        $this->_Sondage = array();

        foreach ($data as $object) {
            $this->addSondage($object);
        }

        return $this;
    }

    /**
     * Sets dependent relations fk_sondage_sondagepersonne1
     *
     * @param Application_Model_Sondage $data
     * @return Application_Model_Sondagepersonne
     */
    public function addSondage(Application_Model_Sondage $data)
    {
        $this->_Sondage[] = $data;
        return $this;
    }

    /**
     * Gets dependent fk_sondage_sondagepersonne1
     *
     * @param boolean $load Load the object if it is not already
     * @return array The array of Application_Model_Sondage
     */
    public function getSondage($load = true)
    {
        if ($this->_Sondage === null && $load) {
            $this->getMapper()->loadRelated('FkSondageSondagepersonne1', $this);
        }

        return $this->_Sondage;
    }

    /**
     * Returns the mapper class for this model
     *
     * @return Application_Model_Mapper_Sondagepersonne
     */
    public function getMapper()
    {
        if ($this->_mapper === null) {
            $this->setMapper(new Application_Model_Mapper_Sondagepersonne());
        }

        return $this->_mapper;
    }

    /**
     * Deletes current row by deleting the row that matches the primary key
     *
	 * @see Application_Model_Mapper_Sondagepersonne::delete
     * @return int|boolean Number of rows deleted or boolean if doing soft delete
     */
    public function deleteRowByPrimaryKey()
    {
        if ($this->getIdsondagepersonne() === null) {
            throw new Exception('Primary Key does not contain a value');
        }

        return $this->getMapper()
                    ->getDbTable()
                    ->delete('idsondagepersonne = ' .
                             $this->getMapper()
                                  ->getDbTable()
                                  ->getAdapter()
                                  ->quote($this->getIdsondagepersonne()));
    }
}
